home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 21
/
Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso
/
Aminet
/
comm
/
cnet
/
ansi_pack.lha
/
TestDoor
< prev
Wrap
Text File
|
1996-12-04
|
9KB
|
220 lines
/**************************************************************************\
$VER: TEST Door, v0.00 (00-Jan-00) by Dotoran!
\**************************************************************************/
options results;signal on SYNTAX;signal on ERROR;signal on IOERR
ver=word(sourceline(2),4);a=word(sourceline(2),5);parse var a "("vdate")"
tr=transmit;se=sendstring;gc=getchar;gu=getuser;gs=getscratch;mg=maygetchar
a='rexxsupport.library';if ~show('l',a) then if ~addlib(a,0,-30) then exit
/***************************************************************************\
Insert your test code between the following two COMMENT Lines!
\***************************************************************************/
a=random(,,time("s")) ; se "f1Hello"
gu 27 ; cols=result ; gu 1100468 ; rows=result
do forever until k="q" ; mg ; k=result
row=random(1,(rows%2)-5) ; col=random(1,(cols%2)-5)-1
co=substr("0123456789abcdef",random(1,16),1)
char=d2c(random(161,255)) ; a=random(1,5)
do i=1 to a
se ""row+i";"col+i"Hc"co||char
se ""row+i";"cols-col-i"Hc"co||char
se ""rows-row-i";"col+i"Hc"co||char
se ""rows-row-i";"cols-col-i"Hc"co||char
end i
end ; tr "1HGood Bye!"
exit
gu 3 ; realname=result ; gu 6 ; street=result
gu 4 ; citystate=result ; gu 5 ; zip=result
kb.1=" Real Name:" ; kb.2="Street Address:"
kb.3=" City, State:" ; kb.4=" Zip Code:"
tr "f1z4c7 Simple AnsiARexx VDE Editor z0n1"
tr "z4c7 Real Name:z0 c3"realname
tr "z4c7Street Address:z0 c3"street
tr "z4c7 City, State:z0 c3"citystate
tr "z4c7 Zip Code:z0 c3"zip
kb=1 ; kbt=4 ; save=0
EDIT:
se ""kb+2";1Hz7c4"kb.kb"z0q1"
do until k~="NOCHAR" ; mg ; k=result ; end ; kk=""
if c2d(k)=27 then do 2 ; mg ; kk=result ; end
if c2d(k)=27 & kk="NOCHAR" then signal SAVE
se ""kb+2";Hz4c7"kb.kb"z0"
if kk="A" then do ; kb=kb-1 ; if kb<1 then kb=kbt ; end
if kk="B" then do ; kb=kb+1 ; if kb>kbt then kb=1 ; end
if c2d(k)=13 then do
if kb=1 then do ; se ""kb+2";17Hz3L1305640 #"realname"}s"
se left("",34)"uz3c4I20 34}";gu 70;a=result;save=(a~=realname)
se "z0c3u"left(a,34);realname=a;signal EDIT;end
if kb=2 then do ; se ""kb+2";17Hz3L1305640 #"street"}s"
se left("",30)"uz3c4I20 30}";gu 70;a=result;save=(a~=street)
se "z0c3u"left(a,30);street=a;signal EDIT;end
if kb=3 then do ; se ""kb+2";17Hz3L1305640 #"citystate"}s"
se left("",22)"uz3c4I20 22}";gu 70;a=result;save=(a~=citystate)
se "z0c3u"left(a,22);citystate=a;signal EDIT;end
if kb=4 then do ; se ""kb+2";17Hz3L1305640 #"zip"}s"
se left("",10)"uz3c4I20 10}";gu 70;a=result;save=(a~=zip)
se "z0c3u"left(a,10);zip=a;signal EDIT;end
end
signal EDIT
SAVE:
if save=0 then tr "1HNo changes made... Exiting..."
else tr "1HChanges Made! Data automatically SAVED, then exit..."
exit
gu 3 ; realname=result ; gu 6 ; street=result
gu 4 ; citystate=result ; gu 5 ; zip=result
kb.1=" Real Name:" ; kb.2="Street Address:"
kb.3=" City, State:" ; kb.4=" Zip Code:"
tr "f1z4c7 Simple AnsiARexx VDE Editor z0n1"
tr "z4c7 Real Name:z0 c3"realname
tr "z4c7Street Address:z0 c3"street
tr "z4c7 City, State:z0 c3"citystate
tr "z4c7 Zip Code:z0 c3"zip
kb=1 ; kbt=4
EDIT:
se ""kb+2";1Hz7c4"kb.kb"z0q1"
do until k~="NOCHAR" ; mg ; k=result ; end ; kk=""
if c2d(k)=27 then do 2 ; mg ; kk=result ; end
if c2d(k)=27 & kk="NOCHAR" then do ; tr "1HExiting..." ; exit ; end
se ""kb+2";Hz4c7"kb.kb"z0"
if kk="A" then do ; kb=kb-1 ; if kb<1 then kb=kbt ; end
if kk="B" then do ; kb=kb+1 ; if kb>kbt then kb=1 ; end
if c2d(k)=13 then do
if kb=1 then do ; se ""kb+2";17Hr1c3L1305640 #"realname"}I20 34}"
gu 70;realname=result;signal EDIT;end
if kb=2 then do ; se ""kb+2";17Hr1c3L1305640 #"street"}I20 30}"
gu 70;street=result;signal EDIT;end
if kb=3 then do ; se ""kb+2";17Hr1c3L1305640 #"citystate"}I20 22}"
gu 70;citystate=result;signal EDIT;end
if kb=4 then do ; se ""kb+2";17Hr1c3L1305640 #"zip"}I20 10}"
gu 70;zip=result;signal EDIT;end
end
signal EDIT
tr "f1.--.--.--.--.--.--.--.--.--.--."
do 9;tr "| | | | | | | | | | |"
tr "|--+--+--+--+--+--+--+--+--+--|";end
tr "| | | | | | | | | | |"
tr "`--^--^--^--^--^--^--^--^--^--'"
row=1 ; col=1
MOVE:
se ""row*2";"col*3-1"H>"
do until k~="NOCHAR" ; mg ; k=result ; end ; kk=""
if c2d(k)=27 then do 2 ; mg ; kk=result ; end
if c2d(k)=27 & kk="NOCHAR" then do ; se "1HExiting..." ; exit ; end
if c2d(k)=13 then do ; se ""row*2";"col*3"H#" ; signal MOVE ; end
/*
if c2d(k)=13 then do ; se "1HRow: "row", Column: "col ; exit ; end
*/
tr ""row*2";"col*3-1"H "
if k="8" | kk="A" then do ; row=row-1 ; if row<1 then row=10 ; end
if k="2" | kk="B" then do ; row=row+1 ; if row>10 then row=1 ; end
if k="6" | kk="C" then do ; col=col+1 ; if col>10 then col=1 ; end
if k="4" | kk="D" then do ; col=col-1 ; if col<1 then col=10 ; end
signal MOVE
tr "f1.--.--.--.--.--.--.--.--.--.--."
do 9;tr "| | | | | | | | | | |"
tr "|--+--+--+--+--+--+--+--+--+--|";end
tr "| | | | | | | | | | |"
tr "`--^--^--^--^--^--^--^--^--^--'"
row=1 ; col=1
MOVE:
se ""row*2";"col*3-1"H>"
/*
se ""row*2";"col*3-1"H"
*/
do until k~="NOCHAR" ; mg ; k=result ; end ; kk=""
if c2d(k)=27 then do 2 ; mg ; kk=result ; end
/*
se ""row*2";"col*3-1"H"
gc ; k=result ; kk="" ; if c2d(k)=27 then do 2 ; mg ; kk=result ; end
if c2d(k)=27 & kk="NOCHAR" then do ; se "1HExiting..." ; exit ; end
*/
if c2d(k)=13 then do ; se "1HRow: "row", Column: "col ; exit ; end
tr ""row*2";"col*3-1"H "
if k="8" | kk="A" then do ; row=row-1 ; if row<1 then row=10 ; end
if k="2" | kk="B" then do ; row=row+1 ; if row>10 then row=1 ; end
if k="6" | kk="C" then do ; col=col+1 ; if col>10 then col=1 ; end
if k="4" | kk="D" then do ; col=col-1 ; if col<1 then col=10 ; end
/*
if kk="A" then do ; row=row-1 ; if row<1 then row=10 ; end
if kk="B" then do ; row=row+1 ; if row>10 then row=1 ; end
if kk="C" then do ; col=col+1 ; if col>10 then col=1 ; end
if kk="D" then do ; col=col-1 ; if col<1 then col=10 ; end
if kk="A" & row>1 then row=row-1
if kk="B" & row<10 then row=row+1
if kk="C" & col<10 then col=col+1
if kk="D" & col>1 then col=col-1
*/
signal MOVE
KEYS2:
tr "Press some keys now..."
do forever until k="Q"
gc ; k=result ; kk="" ; if c2d(k)=27 then do 2 ; gc ; kk=result ; end
select
when c2d(k)=27 & kk="" then tr "You pressed the ESCape key..."
when kk="A" then tr "You pressed the UP cursor arrow..."
when kk="B" then tr "You pressed the DOWN cursor arrow..."
when kk="C" then tr "You pressed the RIGHT cursor arrow..."
when kk="D" then tr "You pressed the LEFT cursor arrow..."
when c2d(k)=13 then tr "You pressed the ENTER key..."
when c2d(k)=9 then tr "You pressed the TAB key..."
when c2d(k)=127 then tr "You pressed the DELETE key..."
when c2d(k)=8 then tr "You pressed the BACKSPACE key..."
when c2d(k)=32 then tr "You pressed the SPACEBAR key..."
otherwise tr "You pressed the "k" key..."
end
end
exit
KEYS1:
tr "Press some keys now..."
do forever until k="q"
mg ; k=result ; kk="" ; if k="NOCHAR" then iterate
if c2d(k)=27 then do 2 ; mg ; kk=result ; end
select
when c2d(k)=27 & kk="NOCHAR" then tr "You pressed the ESCape key..."
when kk="A" then tr "You pressed the UP cursor arrow..."
when kk="B" then tr "You pressed the DOWN cursor arrow..."
when kk="C" then tr "You pressed the RIGHT cursor arrow..."
when kk="D" then tr "You pressed the LEFT cursor arrow..."
when c2d(k)=13 then tr "You pressed the ENTER key..."
when c2d(k)=9 then tr "You pressed the TAB key..."
when c2d(k)=127 then tr "You pressed the DELETE key..."
when c2d(k)=8 then tr "You pressed the BACKSPACE key..."
when c2d(k)=32 then tr "You pressed the SPACEBAR key..."
otherwise tr "You pressed the "k" key..."
end
end
exit
START2:
se "Press any key now(press Q to quit): "
do until k~="NOCHAR" ; mg ; k=result ; end
tr c2d(k) ; if k="q" then exit
signal START2
START:
se "Press any key now(press Q to quit): "
gc ; k=result ; tr k
if k="Q" then exit
signal START
/***************************************************************************/
exit
CHECK:;if ARG() & ARG(1)~='###PANIC' then return ARG(1)
getcarrier;if result='TRUE' then if ARG() then return ARG(1);else return
logentry 'Lost Carrier!!';bufferflush;exit
SYNTAX:;ERROR:;IOERR:;e1='n1 Error: 'rc' ('errortext(rc)')'
e2=' Line: 'left(sigl,4)'File:';gu 1311992;a=result;gu 1311960
b=result;c='"'a||b', 'ver'"';e2=e2' 'c;tr e1;tr e2;logentry e1
logentry e2;e=translate(sourceline(sigl),"\{","");do while e~=''
e3='Source: 'left(e,37);tr e3;logentry e3;e=substr(e,38);end;bufferflush
/**************************************************************************\
\****************************************** Frontiers BBS (716)/823-9892 **/